package com.yc.example.service;

import com.yc.example.dao.UserDao;
import com.yc.example.entity.User;
import com.yc.example.util.ValidateUtil;
import com.yc.example.bean.Msg;

public class UserService {

	private UserDao userDao = new UserDao();
	
	/**
	 * 
	 * @param userName
	 * @param password
	 * @return
	 */
	public Msg login(String userName,String password){
		
		User user = new User();
		
		if(ValidateUtil.isInvalidString(userName)){
			return new Msg("用户名为空",null);
		}
		user.setUserName(userName);
		user.setPassword(password);
		Msg msg = userDao.login(user);
		return msg;
	}
}
